/**
 * 城市管理Api
 * @author 方礼爱
 * @version 1.0.0
 */
import request from '@/utils/request'

/**
 * 查询城市信息
 * @param {查询参数} params
 */
export const search = (params) => {
  return request.fetchGet('/admin/config/city/search', params)
}

export const getCityInfo = (params) => {
  return request.fetchGet('/admin/config/city/getCityInfo', params)
}

export const switchHotCity = (cityId) => {
  return request.fetchGet('/admin/config/city/switch/hot/' + cityId, null)
}
export const switchEnable = (cityId) => {
  return request.fetchGet('/admin/config/city/switch/enable/' + cityId, null)
}
/**
 *
 * @param {} cityCodes
 */
export const saveCityConfig = (params) => {
  return request.fetchPost('/admin/config/city/open', params)
}

/**
 *
 * @param {} id
 */
export const close = (cityCodes) => {
  return request.fetchPost('/admin/config/city/close', { cityCodes: cityCodes })
}

